package com.bruce.springbootDemo.web.controller;

import com.bruce.springbootDemo.annotation.PathRestController;
import com.bruce.springbootDemo.model.entity.TUser;
import com.bruce.springbootDemo.web.restFul.ResponseEntity;
import com.bruce.springbootDemo.web.restFul.ResponseTool;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@PathRestController(value = "/test")
public class TestController {
    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @PostMapping("/login")
    public ResponseEntity login(@RequestBody String name, @RequestBody String password) throws Exception {
        TUser tUser = new TUser();
        tUser.setName(name);
        logger.info(name);
        logger.info(password);
        return ResponseTool.ok(tUser);
    }

}
